/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import java.util.LinkedHashMap;
import java.util.Map;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.JOptionPane;
/**
 *
 * @author sneiderhc
 */
public class PrincipalGUI extends javax.swing.JFrame {

    /**
     * Creates new form PrincipalGUI
     */
    
    Order woody = new Order();
    GeneratePDF pdf = new GeneratePDF(); 
    public PrincipalGUI() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        DatajPanel = new javax.swing.JPanel();
        NamejLabel = new javax.swing.JLabel();
        NamejTextField = new javax.swing.JTextField();
        AddressjLabel = new javax.swing.JLabel();
        AddressjTextField = new javax.swing.JTextField();
        HardwoodjPanel = new javax.swing.JPanel();
        ContinuejButton = new javax.swing.JButton();
        CherryjLabel = new javax.swing.JLabel();
        CurlyMaplejLabel = new javax.swing.JLabel();
        GenuineMahoganyjLabel = new javax.swing.JLabel();
        WergejLabel = new javax.swing.JLabel();
        WhiteOakjLabel = new javax.swing.JLabel();
        SawdustjLabel = new javax.swing.JLabel();
        HardwoodjLabel = new javax.swing.JLabel();
        CherryjSlider = new javax.swing.JSlider();
        CurlyMaplejSlider = new javax.swing.JSlider();
        GenuineMahoganyjSlider = new javax.swing.JSlider();
        WergejSlider = new javax.swing.JSlider();
        WhiteOakjSlider = new javax.swing.JSlider();
        SawdustjSlider = new javax.swing.JSlider();
        CherryCantjLabel = new javax.swing.JLabel();
        CurlyMCantjLabel = new javax.swing.JLabel();
        GenuineMCantjLabel = new javax.swing.JLabel();
        WergeCantjLabel = new javax.swing.JLabel();
        WhiteOCantjLabel = new javax.swing.JLabel();
        SawdustCantjLabel = new javax.swing.JLabel();
        FilejButton = new javax.swing.JButton();
        TitlejLabel = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        DatajPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Buyer Data", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 0, 0))); // NOI18N

        NamejLabel.setText("Full Name:");

        NamejTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NamejTextFieldActionPerformed(evt);
            }
        });

        AddressjLabel.setText("Address of Delivery:");

        javax.swing.GroupLayout DatajPanelLayout = new javax.swing.GroupLayout(DatajPanel);
        DatajPanel.setLayout(DatajPanelLayout);
        DatajPanelLayout.setHorizontalGroup(
            DatajPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(DatajPanelLayout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(DatajPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(AddressjLabel)
                    .addComponent(NamejLabel))
                .addGap(18, 18, 18)
                .addGroup(DatajPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(NamejTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE)
                    .addComponent(AddressjTextField))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        DatajPanelLayout.setVerticalGroup(
            DatajPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(DatajPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(DatajPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(NamejLabel)
                    .addComponent(NamejTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(DatajPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(AddressjLabel)
                    .addComponent(AddressjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        HardwoodjPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Type of Hardwood and/or Sawdust", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 0, 0))); // NOI18N

        ContinuejButton.setText("Continue");
        ContinuejButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ContinuejButtonActionPerformed(evt);
            }
        });

        CherryjLabel.setText("Cherry");

        CurlyMaplejLabel.setText("Curly Maple");

        GenuineMahoganyjLabel.setText("Genuine Mahogany");

        WergejLabel.setText("Wenge");

        WhiteOakjLabel.setText("White Oak");

        SawdustjLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        SawdustjLabel.setText("Sawdust");

        HardwoodjLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        HardwoodjLabel.setText("Hardwood");

        CherryjSlider.setMaximum(1000);
        CherryjSlider.setPaintLabels(true);
        CherryjSlider.setValue(0);
        CherryjSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                CherryjSliderStateChanged(evt);
            }
        });

        CurlyMaplejSlider.setMaximum(1000);
        CurlyMaplejSlider.setPaintLabels(true);
        CurlyMaplejSlider.setToolTipText("");
        CurlyMaplejSlider.setValue(0);
        CurlyMaplejSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                CurlyMaplejSliderStateChanged(evt);
            }
        });

        GenuineMahoganyjSlider.setMaximum(1000);
        GenuineMahoganyjSlider.setValue(0);
        GenuineMahoganyjSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                GenuineMahoganyjSliderStateChanged(evt);
            }
        });

        WergejSlider.setMaximum(1000);
        WergejSlider.setValue(0);
        WergejSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                WergejSliderStateChanged(evt);
            }
        });

        WhiteOakjSlider.setMaximum(1000);
        WhiteOakjSlider.setValue(0);
        WhiteOakjSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                WhiteOakjSliderStateChanged(evt);
            }
        });

        SawdustjSlider.setMaximum(1000);
        SawdustjSlider.setValue(0);
        SawdustjSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                SawdustjSliderStateChanged(evt);
            }
        });

        CherryCantjLabel.setText("0");

        CurlyMCantjLabel.setText("0");

        GenuineMCantjLabel.setText("0");

        WergeCantjLabel.setText("0");

        WhiteOCantjLabel.setText("0");

        SawdustCantjLabel.setText("0");

        FilejButton.setText("Load from File");
        FilejButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FilejButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout HardwoodjPanelLayout = new javax.swing.GroupLayout(HardwoodjPanel);
        HardwoodjPanel.setLayout(HardwoodjPanelLayout);
        HardwoodjPanelLayout.setHorizontalGroup(
            HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, HardwoodjPanelLayout.createSequentialGroup()
                .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(HardwoodjPanelLayout.createSequentialGroup()
                        .addGap(49, 49, 49)
                        .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(WhiteOakjLabel)
                            .addComponent(WergejLabel)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, HardwoodjPanelLayout.createSequentialGroup()
                                .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(HardwoodjPanelLayout.createSequentialGroup()
                                        .addGap(0, 0, Short.MAX_VALUE)
                                        .addComponent(FilejButton))
                                    .addGroup(HardwoodjPanelLayout.createSequentialGroup()
                                        .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(GenuineMahoganyjLabel)
                                            .addComponent(CherryjLabel)
                                            .addComponent(CurlyMaplejLabel))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
                                        .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(WergeCantjLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(CherryCantjLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 33, Short.MAX_VALUE)
                                            .addComponent(GenuineMCantjLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(WhiteOCantjLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(SawdustCantjLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(CurlyMCantjLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                                .addGap(21, 21, 21))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, HardwoodjPanelLayout.createSequentialGroup()
                        .addGap(33, 33, 33)
                        .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(HardwoodjLabel)
                            .addComponent(SawdustjLabel))
                        .addGap(18, 18, Short.MAX_VALUE)))
                .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(ContinuejButton)
                    .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(CurlyMaplejSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(CherryjSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(GenuineMahoganyjSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(WergejSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(WhiteOakjSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(SawdustjSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(46, 46, 46))
        );
        HardwoodjPanelLayout.setVerticalGroup(
            HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, HardwoodjPanelLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(HardwoodjLabel)
                .addGap(18, 18, 18)
                .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(CherryjLabel)
                        .addComponent(CherryCantjLabel))
                    .addComponent(CherryjSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(CurlyMaplejLabel)
                        .addComponent(CurlyMCantjLabel))
                    .addComponent(CurlyMaplejSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(GenuineMahoganyjLabel)
                        .addComponent(GenuineMCantjLabel))
                    .addComponent(GenuineMahoganyjSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(WergejLabel)
                        .addComponent(WergeCantjLabel))
                    .addComponent(WergejSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(WhiteOakjLabel)
                        .addComponent(WhiteOCantjLabel))
                    .addGroup(HardwoodjPanelLayout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(WhiteOakjSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(12, 12, 12)
                .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(HardwoodjPanelLayout.createSequentialGroup()
                        .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(SawdustjLabel)
                            .addComponent(SawdustCantjLabel))
                        .addGap(24, 101, Short.MAX_VALUE))
                    .addGroup(HardwoodjPanelLayout.createSequentialGroup()
                        .addComponent(SawdustjSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(HardwoodjPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ContinuejButton)
                            .addComponent(FilejButton))
                        .addGap(21, 21, 21))))
        );

        TitlejLabel.setFont(new java.awt.Font("Tahoma", 3, 14)); // NOI18N
        TitlejLabel.setText("Welcome to VeLuvana Inc");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(TitlejLabel)
                .addGap(146, 146, 146))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(DatajPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(HardwoodjPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addComponent(TitlejLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
                .addComponent(DatajPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(HardwoodjPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        getAccessibleContext().setAccessibleName("PrincipaljFrame");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void ContinuejButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ContinuejButtonActionPerformed
        // TODO add your handling code here:
        if(this.NamejTextField.getText().equals(""))
            JOptionPane.showMessageDialog(this, "You must write your name");
        else if(this.AddressjTextField.getText().equals(""))
            JOptionPane.showMessageDialog(this, "You must specify an address");
        else if(this.CherryjSlider.getValue() == 0 & this.CurlyMaplejSlider.getValue() == 0
               & this.GenuineMahoganyjSlider.getValue() == 0 & this.WergejSlider.getValue() == 0
               & this.WhiteOakjSlider.getValue() == 0 & this.SawdustjSlider.getValue() == 0)
            JOptionPane.showMessageDialog(this, "You must select at least one product");
        else{
            woody.setName(this.NamejTextField.getText());
            woody.setAddress(this.AddressjTextField.getText());
            Map m = new LinkedHashMap();
            m.put("cherry", this.CherryjSlider.getValue());
            m.put("maple", this.CurlyMaplejSlider.getValue());
            m.put("mahogany", this.GenuineMahoganyjSlider.getValue());
            m.put("wenge", this.WergejSlider.getValue());
            m.put("whiteoak", this.WhiteOakjSlider.getValue());
            m.put("sawdust", this.SawdustjSlider.getValue());
            woody.setQuantity(m);
            woody.calculatePrice();
            woody.deliveryTime();
            pdf.Generate(woody);
        }
    }//GEN-LAST:event_ContinuejButtonActionPerformed

    private void CherryjSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_CherryjSliderStateChanged
        // TODO add your handling code here:        
        this.CherryCantjLabel.setText(this.CherryjSlider.getValue()+"");
    }//GEN-LAST:event_CherryjSliderStateChanged

    private void CurlyMaplejSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_CurlyMaplejSliderStateChanged
        // TODO add your handling code here:
        this.CurlyMCantjLabel.setText(this.CurlyMaplejSlider.getValue()+"");
    }//GEN-LAST:event_CurlyMaplejSliderStateChanged

    private void GenuineMahoganyjSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_GenuineMahoganyjSliderStateChanged
        // TODO add your handling code here:                
        this.GenuineMCantjLabel.setText(this.GenuineMahoganyjSlider.getValue()+"");
    }//GEN-LAST:event_GenuineMahoganyjSliderStateChanged

    private void WergejSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_WergejSliderStateChanged
        // TODO add your handling code here:                
        this.WergeCantjLabel.setText(this.WergejSlider.getValue()+"");
    }//GEN-LAST:event_WergejSliderStateChanged

    private void WhiteOakjSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_WhiteOakjSliderStateChanged
        // TODO add your handling code here:                
        this.WhiteOCantjLabel.setText(this.WhiteOakjSlider.getValue()+"");        
    }//GEN-LAST:event_WhiteOakjSliderStateChanged

    private void SawdustjSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_SawdustjSliderStateChanged
        // TODO add your handling code here:     
        this.SawdustCantjLabel.setText(this.SawdustjSlider.getValue()+"");
    }//GEN-LAST:event_SawdustjSliderStateChanged

    private void NamejTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NamejTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_NamejTextFieldActionPerformed

    private void FilejButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FilejButtonActionPerformed
        // TODO add your handling code here:
        JOptionPane.showMessageDialog(this,
            "The .txt File must have the next formay\n" +
            "(Quantity must be between 0 and 1000):\n\n" +
            "Name: name\n" +
            "Address: address\n" +
            "Cherry: quantity\n" +
            "Curly Maple: quantity\n" +
            "Genuine Mahogany: quantity\n" +
            "Wenge: quantity\n" +
            "White Oak: quantity\n" +
            "Sawdust: quantity");
        JFileChooser jfc = new JFileChooser();
        jfc.removeChoosableFileFilter(jfc.getAcceptAllFileFilter());
        jfc.setFileFilter(new FileNameExtensionFilter(".txt file", "txt"));
        if (jfc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
            FileReader fr = new FileReader();
            if(fr.read(woody, jfc.getSelectedFile()) && woody.deliveryTime()) {
                woody.calculatePrice();
                pdf.Generate(woody);
            }
            else {
                JOptionPane.showMessageDialog(this, "Invalid file format.");
            }
        }
    }//GEN-LAST:event_FilejButtonActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(PrincipalGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(PrincipalGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(PrincipalGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(PrincipalGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new PrincipalGUI().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel AddressjLabel;
    private javax.swing.JTextField AddressjTextField;
    private javax.swing.JLabel CherryCantjLabel;
    private javax.swing.JLabel CherryjLabel;
    private javax.swing.JSlider CherryjSlider;
    private javax.swing.JButton ContinuejButton;
    private javax.swing.JLabel CurlyMCantjLabel;
    private javax.swing.JLabel CurlyMaplejLabel;
    private javax.swing.JSlider CurlyMaplejSlider;
    private javax.swing.JPanel DatajPanel;
    private javax.swing.JButton FilejButton;
    private javax.swing.JLabel GenuineMCantjLabel;
    private javax.swing.JLabel GenuineMahoganyjLabel;
    private javax.swing.JSlider GenuineMahoganyjSlider;
    private javax.swing.JLabel HardwoodjLabel;
    private javax.swing.JPanel HardwoodjPanel;
    private javax.swing.JLabel NamejLabel;
    private javax.swing.JTextField NamejTextField;
    private javax.swing.JLabel SawdustCantjLabel;
    private javax.swing.JLabel SawdustjLabel;
    private javax.swing.JSlider SawdustjSlider;
    private javax.swing.JLabel TitlejLabel;
    private javax.swing.JLabel WergeCantjLabel;
    private javax.swing.JLabel WergejLabel;
    private javax.swing.JSlider WergejSlider;
    private javax.swing.JLabel WhiteOCantjLabel;
    private javax.swing.JLabel WhiteOakjLabel;
    private javax.swing.JSlider WhiteOakjSlider;
    // End of variables declaration//GEN-END:variables
}
